package com.hk.welcome;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hk.action.Action;
import com.hk.action.ActionForward;
import com.hk.dtos.BBSDto;
import com.hk.file.FileManager;
import com.hk.service.BBSService;
import com.jungbo.file.dto.FileDto;

public class ModAction implements Action{
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
	BBSService manager=BBSService.getInstance();
	BBSDto dto = new BBSDto();
	
    String tseq = request.getParameter("seq");
    int seq = Integer.parseInt(tseq);
    BBSDto tdto = new BBSDto();
    tdto.setSeq(seq);
    tdto.setBbsname("BBS");
    
    dto=manager.getBoard(tdto);
    
    FileManager fmanager = new FileManager();
			
    List<FileDto> filelists=fmanager.getFileList(seq);
				
	ActionForward forword=new ActionForward();
	request.setAttribute("fileList", filelists);
	request.setAttribute("board", dto);
	forword.setUrl("modgo");
	forword.setRedirect(false);

	return forword;
}//
}
